package com.thewell79.areadiary;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;

/**
 * Created by THEWELL-LOBBY on 2015-04-27.
 */
public class BaseFragmentContainerActivity extends ActionBarActivity {

    private Toolbar toolbar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_container);

        toolbar = (Toolbar) findViewById(R.id.toolbar);

        setSupportActionBar(toolbar);

        getToolbar().setTitleTextColor(getResources().getColor(android.R.color.white));
        getToolbar().setSubtitleTextColor(getResources().getColor(android.R.color.holo_orange_light));
    }

    public void setFragment(Fragment fragment) {
        getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, fragment).commit();
    }

    public Toolbar getToolbar() {
        return toolbar;
    }
}
